package sctu.edu.java.year2016.team01.xuhanmei.day20160530.chapter9_2;

/**
 * Created by Administrator on 2016/5/30.
 * 创建一个类，在该类中定义一个方法，并在方法内部创建一个局部内部类
 * 通过局部内部类求任意两个数的乘积，并在外部类中进行测试...
 */

import java.util.Scanner;

public class Multiply {
    public void multiply1() {

        System.out.println("请输入两个您想用来相乘的数：");
        Scanner scan1 = new Scanner(System.in);
        Scanner scan2 = new Scanner(System.in);


        class M {
            int x = scan1.nextInt();
            int y = scan2.nextInt();


            void multiplyxy() {
                int sum = x * y;
                System.out.println("结果是："+sum);
            }

        }


        M m1 = new M();
        m1.multiplyxy();
    }


    public static void main(String[] args) {
        Multiply n = new Multiply();
        n.multiply1();
    }
}
